home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-05-09 | 936 b | 29 lines | [TEXT/PICN] |
- ############################################################################
- #
- # catenate.icn
- #
- # This program concatenates files. The user is prompted for an output
- # file with a Put File dialog. Then the user is prompted for the files
- # to concatenate with a Get File dialog. When one set of files is done,
- # the user is prompted with another Put File dialog. The program
- # terminates when the user selects Cancel in a Put File dialog.
- #
- #############################################################################
-
- procedure main()
- local outname, outfile, inname, infile
-
- while outname := putfile("Output file?") do {
- close(\outfile)
- outfile := open(outname,"w") | stop("*** cannot open ",outname)
- inname := "..."
-
- while inname := getfile("File? (last was " || inname ||" )") do {
- close(\infile)
- infile := open(inname) | stop("*** cannot open ",inname)
-
- while write(outfile,read(infile))
- }
- }
-
- end